export default {
  namespaced: true,
  state: {
    // active
    active: 0,
    buttonText: '下一步',
    status: 'success'
  },
  mutations: {
    /**
     * @description 切换灰度状态
     * @param {Object} state state
     */
    next(state) {
      if (state.active++ === 1) {
        state.buttonText = '完成'
      }
    },

    last(state) {
      if (state.active-- <= 2) {
        state.buttonText = '下一步'
      }
    },
    clear(state){
      state.active = 0
      state.buttonText = '下一步'
      state.status = 'success'
    },
    direct(state){
      state.active = 4
      state.buttonText = '完成'
      state.status = 'finish'
    }

  }
}
